package logic

import (
	"context"
	"doctor/models"

	"doctor/doctorrpc/doctorrpc"
	"doctor/doctorrpc/internal/svc"

	"github.com/zeromicro/go-zero/core/logx"
)

type ListLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListLogic {
	return &ListLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

// 列表
func (l *ListLogic) List(in *doctorrpc.ListRequest) (*doctorrpc.ListResponse, error) {
	// todo: add your logic here and delete this line

	var doctors []models.Doctor

	var list []*doctorrpc.DocList
	for _, docList := range list {
		lists := doctorrpc.DocList{
			Name:  docList.Name,
			Image: docList.Image,
			Job:   docList.Job,
			Age:   docList.Age,
		}
		doctors = append(doctors, &lists)
	}

	return &doctorrpc.ListResponse{}, nil
}
